﻿(function ($) {
    $.fn.infobox = function (options) {
        var settings = {
            'text': 'loading...',
            'fadedelay': 5000
        };

        return this.each(function () {
            if (options) $.extend(settings, options);
            if ($('.infobox', this).length) $('.infobox', this).remove();

            $(this).css('position', 'relative');
            var div = $('<div class="infobox opacity-70">' + settings.text + '</div>').appendTo(this);

            setTimeout(function () { div.remove(); }, settings.fadedelay);
        });
    };
})(jQuery);